﻿using Homework;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinFormApp0001
{
    public partial class test : Form
    {
        public test()
        {
            InitializeComponent();
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“testDBDataSet.Student”中。您可以根据需要移动或删除它。
            //this.studentTableAdapter.Fill(this.testDBDataSet.Student);
            var cmdString = "select * from Student";
            var dataTable = DbHelper.GetDataTable(cmdString);

            DataGridView dataGridView = new DataGridView();

            //OtherForm otherFrom = new OtherForm();
            //otherFrom.Show();
            //MessageBox.Show("发射成功~","是你吗？");
            //this.Hide();
            //Show();
            //dataGridView1.DataSource = dataTable;
        }

        private void test_MouseClick(object sender, MouseEventArgs e)
        {
            List<Color> colors = new List<Color>();
            colors.Add(Color.Orchid);
            colors.Add(Color.Blue);
            colors.Add(Color.Brown);
            colors.Add(Color.Orange);
            colors.Add(Color.Snow);
            colors.Add(Color.Goldenrod);
            colors.Add(Color.DeepPink);
            colors.Add(Color.Pink);

            Random random = new Random();
            var randInt = random.Next(0, colors.Count);
            var randColor = colors[randInt];
            BackColor = randColor;

        }
    }
}
